//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Linq;

using ProjectBase.Core;

using $prjsn$.Entity;

namespace $safeprojectname$.Tools.Import.Excel
{
    /// <summary>
    /// Entity Address.
    /// </summary>
    [Serializable]
    public class Address : Persistent<int>
    {
        public virtual Country Country { get; set; }
        public virtual string City { get; set; }
        public virtual string Street { get; set; }
        public virtual string Number { get; set; }
        public virtual string PostalCode { get; set; }

        #region override abstract
        /// <summary>
        /// Provides quick, string description about the 'Address' instance
        /// </summary>
        public override string ToDisplay()
        {
            // This method is often used on View
            // there for provide clear and understandable
            // set of properties (separated by spaces ' ')
            // which will quickly provide information about this instance
            return IDToDisplay + " " + Number;
        }

        /// <summary>
        /// Returned value should be handled as business unique key.
        /// Equal method (implemented in Tracked base class) will use it
        /// to compare two Addresss
        /// </summary>
        protected override string GetDomainObjectSignature()
        {
            // TODO return the property (or list of properties separated by "|")
            // which will allow to distinguish among entities
            return Street;
        }

        #endregion override abstract

        public virtual void CopyTo(Address address)
        {
            address.Country = Country;
            address.City = City;
            address.Street = Street;
            address.Number = Number;
            address.PostalCode = PostalCode;
        }
    }
}


